package com.atguigu.gmall.feign.cart;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.order.OrderDetail;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/api/inner/cart")
@FeignClient("service-cart")
public interface CartFeignClient {


    @PostMapping("/clear/cart/items")
    Result clearCartItems(@RequestBody List<Long> skuIds);
    /**
     * 给购物车中添加一个商品
     * @param skuId
     * @param skuNum
     * @return
     */
    @GetMapping("/addtocart/{skuId}")
    Result addSkuToCart(@PathVariable("skuId") Long skuId,
                        @RequestParam("skuNum") Integer skuNum);

    /**
     * 查出购物车中所有商品列表数据
     * @return
     */
    @GetMapping("/order/infos")
    Result<List<OrderDetail>> getCartInfoForOrder();
}
